package ${package.ServiceImpl};

import ${package.Entity}.${entity};
import ${package.Mapper}.${table.mapperName};
import ${package.Service}.${table.serviceName};
import org.springframework.stereotype.Service;
import org.apache.ibatis.annotations.Param;
import javax.annotation.Resource;
import java.util.List;
import org.springframework.context.annotation.Primary;

@Primary
@Service
public class ${table.serviceImplName} implements ${table.serviceName} {

@Resource
private ${table.mapperName} ${table.entityPath}Mapper;

@Override
public List<${entity}> listAll${entity}() { return ${table.entityPath}Mapper.listAll${entity}();}

<#list table.fields as field>
    <#if field.keyFlag>
        @Override
        public ${entity} list${entity}By${field.propertyName}(@Param("${field.propertyName}") ${field.propertyType} ${field.propertyName}) { return ${table.entityPath}Mapper.list${entity}By${field.propertyName}(${field.propertyName});}
    </#if>
</#list>
}